package binarySearch;

public class QuestionTwo {
    //第一个错误版本   性质：哪个版本错误后所有版本都是错误的调用isBadVersion(i)接口
    public int firstBadVersion(int n) {
        int left = 0,right = n;
        while(left < right){
            int mid = left -(right - left)/2;
            if (isBadVersion(mid)){
                //目标在右侧 缩进left
                right = mid;
            }else if (!isBadVersion(mid)){
                left = mid-1;
            }
        }

        return left;
    }
    public boolean isBadVersion(int mid){
        return false;
    }


}
